package com.leetcode.string.my_atoi;

public class MyAtoiTest {
    public static void main(String[] args) {
        String s = " -484888888888888888888";
        System.out.println(myAtoi(s));
    }
    //设计方法完成对Automaton类的使用
    //参数 String s
    //返回值 int
    public static int myAtoi(String s) {
        Automaton aut = new Automaton();
        for (int i = 0; i < s.length(); i++) {
            aut.get(s.charAt(i));
        }
        return (int) (aut.sign * aut.num);
    }
}
